<!DOCTYPE html>
<html>
<head>
    <title>益多多回收</title>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <link rel="stylesheet" href="${s.base}/mobile/css/weui.min.css">
    <link rel="stylesheet" href="${s.base}/mobile/css/jquery-weui.min.css">
    <link rel="stylesheet" href="${s.base}/mobile/css/base.css">
    <link rel="stylesheet" href="${s.base}/mobile/css/component.css">
    <style type="text/css">
		body,html{background: #e4e4e4;}
    </style>
</head>
<!-- 企业下单 -->
<body>
<div class="xyg-comp-form">
       <div class="xyg-comp-form-item-one">
            <div class="xyg-comp-form-item-title"> 
             姓名
            </div>
            <div class="xyg-comp-form-item-content"> 
             <input type="text" id="memberNickName" value="${recoveryOrder.memberNickName}" disabled />
            </div>
            <div class="clearBoth"></div>
       </div>
    <div class="xyg-comp-form-item-one">
        <div class="xyg-comp-form-item-title">
            处理人
        </div>
        <div class="xyg-comp-form-item-content">
            <input type="text" id="manageMemberNickName" value="${recoveryOrder.manageMemberNickName}" disabled />
        </div>
        <div class="clearBoth"></div>
    </div>
       <div class="xyg-comp-form-item-one">
            <div class="xyg-comp-form-item-title"> 
             下单
            </div>
            <div class="xyg-comp-form-item-content"> 
             <input type="text" id="largeCatName" value="${recoveryOrder.largeCatName}" disabled />
            </div>
            <div class="clearBoth"></div>
       </div>

        <div class="xyg-comp-form-item-one">
            <div class="xyg-comp-form-item-title"> 
             上门地址
            </div>
            <div class="xyg-comp-form-item-content"> 
             <input type="text" id="address" value="${recoveryOrder.address}" disabled />
            </div>
            <div class="clearBoth"></div>
       </div>

       <div class="xyg-comp-form-item-one">
            <div class="xyg-comp-form-item-title"> 
             预约时间
            </div>
            <div class="xyg-comp-form-item-icon">
             <!--<span>请选择预约时间</span>-->
             <input type="text" id="reservationDate" value="${recoveryOrder.reservationDate?string('yyyy-MM-dd hh:mm:ss')}" disabled/>
             <svg class="icon" aria-hidden="true"> 
              <use xlink:href="#iconxiangyou"></use>
             </svg> 
            </div> 
            <div class="clearBoth"></div>
       </div>
        <#if recoveryOrder.money?? && recoveryOrder.money != null && recoveryOrder.money != "">
            <div class="xyg-comp-form-item-one">
                <div class="xyg-comp-form-item-title">
                    处理金额
                </div>
                <div class="xyg-comp-form-item-content">
                    <input type="text" value="${recoveryOrder.money}" disabled />
                </div>
                <div class="clearBoth"></div>
            </div>
            <div class="xyg-comp-form-item-one">
                <div class="xyg-comp-form-item-title">
                    实际斤数
                </div>
                <div class="xyg-comp-form-item-content">
                    <input type="text" value="${recoveryOrder.jin}" disabled />
                </div>
                <div class="clearBoth"></div>
            </div>
        </#if>

    <#if recoveryOrder.manageMemberId?? && memberId == recoveryOrder.manageMemberId && recoveryOrder.status == '1'>
        <div class="xyg-comp-form-item-one">
            <div class="xyg-comp-form-item-title">
                处理金额
            </div>
            <div class="xyg-comp-form-item-content">
                <input type="text" id="money" value="${recoveryOrder.money}" placeholder="请输入处理金额（元）" />
            </div>
            <div class="clearBoth"></div>
        </div>
        <div class="xyg-comp-form-item-one">
            <div class="xyg-comp-form-item-title">
                实际斤数
            </div>
            <div class="xyg-comp-form-item-content">
                <input type="text" id="jin" value="${recoveryOrder.jin}" placeholder="请输入实际斤数（斤）"  />
            </div>
            <div class="clearBoth"></div>
        </div>
        <input type="button" id="save" class="xyg-btn-one color-bs margin-top-1rem" value="提交"/>
        </#if>
  	</div>
</body>
<script src="https://res.wx.qq.com/open/js/jweixin-1.3.2.js"></script>
<script src="${s.base}/mobile/js/jquery-2.1.4.js"></script>
<script src="${s.base}/mobile/js/jquery-weui.js"></script>
<script src="${s.base}/mobile/fonts/iconfont.js"></script>
<script src="${s.base}/mobile/js/component.js"></script>
<script src="${s.base}/mobile/js/base.js"></script>
<script src="${s.base}/mobile/js/ajaxfileupload.js"></script>


<!--js分享代码开始-->
<input type="hidden" value="${jSTicketShareResponse.appid}" id="appid" />
<input type="hidden" value="${jSTicketShareResponse.fxTitle}" id="fxTitle" />
<input type="hidden" value="${jSTicketShareResponse.fxImgUrl}" id="fxImgUrl" />
<input type="hidden" value="${jSTicketShareResponse.fxDesc}" id="fxDesc" />
<input type="hidden" value="${jSTicketShareResponse.fxUrl}" id="fxUrl" />
<input type="hidden" value="${jSTicketShareResponse.nonceStr}" id="nonceStr" />
<input type="hidden" value="${jSTicketShareResponse.timestamp}" id="timestamp" />
<input type="hidden" value="${jSTicketShareResponse.signature}" id="signature" />
<script src="${s.base}/mobile/js/share.js"></script>
<script>
    var id = '${recoveryOrder.id}';
    var memberId = '${memberId}';
    var type = '${type}';
    $("#save").on("click", function () {
        var reg = /^[1-9]\d*$/;
        var money = $("#money").val();
        if (money == null || money == "") {
            $.toast("请输入处理金额", "text");
            return false;
        }
        if (!reg.test(money)){
            $.toast("处理金额请输入正整数！", "text");
            return false;
        }
        var jin = $("#jin").val();
        if (jin == null || jin == "") {
            $.toast("请输入实际斤数", "text");
            return false;
        }
        if (!reg.test(jin)){
            $.toast("实际斤数请输入正整数！", "text");
            return false;
        }
        var param = {
            id: id,
            money:money,
            jin:jin,
            status: '2'
        };
        $.showLoading("正在提交中");
        $.post("/phone/recoveryCircleOrderUpdateStatus", param, function (result) {
            if (0 == result.code) {
                $.hideLoading();
                $.alert("提交成功",function () {
                    // 根据状态返回
                    if (type == '1') {
                        goCircleOrderListPage(memberId);
                    } else {
                        goCircleOrderMemberListPage(memberId);
                    }
                });
            } else {
                $.hideLoading();
                $.alert(result.msg);
            }
        }, "json");
    });
</script>
</html>
